@import "../../styles/prism-theme.less";
@import "../../styles/prism-theme-dark.less";

:host {
  display: block;
}

.TDesign-code-block {
  font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
  border-radius: 6px;
  border: 1px solid var(--component-border);
  position: relative;

  td-doc-copy {
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 10;
  }

  &__header {
    min-height: 48px;
    display: flex;
    box-sizing: border-box;
    box-shadow: var(--header-box-shadow);
    overflow: auto hidden;
    position: relative;

    .header-panel {
      padding: 8px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;

      &:hover {
        .panel-inner {
          background: var(--bg-color-container-hover);
        }
      }

      .panel-inner {
        padding: 8px;
        transition: all 0.2s linear;
        border-radius: 3px;

        &.active {
          color: var(--brand-main);
        }
      }
    }

    .active-line {
      height: 1px;
      position: absolute;
      left: 0;
      bottom: 0px;
      z-index: 10;
      background: var(--brand-main);
      transition: all 0.2s var(--anim-time-fn-easing);
    }
  }

  &__body {
    max-height: 334px;
    box-sizing: border-box;
    background-color: var(--bg-color-code);

    pre {
      margin: 0;
      padding: 24px;
      max-height: 334px;
      box-sizing: border-box;
      overflow: auto;
      background: var(--bg-color-code);
      color: var(--text-primary);

      &:hover {

        &::-webkit-scrollbar-thumb {
          background-color: var(--bg-color-scroll);
        }
      }
    
      &::-webkit-scrollbar {
        width: 12px;
        height: 12px;
        background: transparent;
      }

      &::-webkit-scrollbar-corner {
        width: 0;
      }
    
      &::-webkit-scrollbar-thumb {
        border-radius: 6px;
        border: 4px solid transparent;
        background-clip: content-box;
        background-color: transparent;
      }
    }
  }
}
